home *** CD-ROM | disk | FTP | other *** search
-
- Example4.c
- ==========
-
- This example shows the use of dynamic parent/child behaviour.
- The example class is a simple 'Double' class, which just has
- 1 instance field (Number N).
-
- How it works
- ------------
-
- The 'my_DoubleClass' only has two method defined;
-
- OBM_GETATTR - Set's the BTA_LongNumber to the object instance N. It also
- print's out the N values of the parent objects. See the
- OBJ_MethodToParent function, technically spoken the MTHF_DOPARENTS
- flag in this example could be omited. This because only
- one parent object will be called, why?, there is only one
- value to fill in (BTA_NumberOf = 1), after this the MTHF_DOPARENTS
- flag is reset.
- It is good practice (and required) to set the MTHF_DOPARENTS flag
- because it is possible that there are _other_ objects inserted
- between your objects.
-
- OBM_SETATTR - Set's the instance N to BTA_LongNumber. It sets also the children
- objects if the MTHF_PASSTOCHILD was set. To do this the ti_Data
- is multiplied by 2, the nr_attr is increased with 1 because
- otherwise the BTA_NumberOf tag is processed and the MethodFlags
- will be reseted. Finally the BTF_Ignore is cleared.
-
- Now one OBM_SETATTR call of the root parent object with the MTHF_PASSTOCHILD
- flags is enough to set all objects.
-